YAHOO.namespace('ext.SVG');

YAHOO.ext.SVG.Line = function(renderTo,config){
	YAHOO.ext.SVG.Line.superclass.constructor.call(this, renderTo,config);
	}
YAHOO.extendX(YAHOO.ext.SVG.Line, YAHOO.ext.Vector.Line, {
    lineTemplate : new YAHOO.ext.DomHelper.Template('<line id="{id}" ' + 
	        ' class="{cls}" style="left:{left};top:{top};stroke:{strokecolor};strokewidth={strokeweight}" ' +
	        'x1="{fromx}" y1="{fromy}" x2="{tox}" y2="{toy}" xmlns="http://www.w3.org/2000/svg">' + 
	        '</line>')
});	
YAHOO.ext.SVG.Box = function(renderTo,config){
	this.fill="none";
	this.stroke="none";
	YAHOO.ext.SVG.Box.superclass.constructor.call(this, renderTo,config);
}
YAHOO.extendX(YAHOO.ext.SVG.Box, YAHOO.ext.Vector.Box,{
	boxTemplate : new YAHOO.ext.DomHelper.Template('<g transform="translate({left},{top})"><rect id="{id}" ' + 
	        ' class="{cls}" style="position:relative;" x="0" y="0" fill="{fill}" ' +
	        'width="{width}" height="{height}" stroke="{strokecolor}" strokewidth="{strokeweight}">' + 
	        '</rect><text x="5" y="15" font-family="Verdana" font-size="9">{text}</text></g>')
});
YAHOO.ext.SVG.RoundBox = function(renderTo,config){
	this.fill="none";
	YAHOO.ext.SVG.RoundBox.superclass.constructor.call(this, renderTo,config);
}
YAHOO.extendX(YAHOO.ext.SVG.RoundBox, YAHOO.ext.Vector.RoundBox,{
	boxTemplate : new YAHOO.ext.DomHelper.Template('<g transform="translate({left},{top})"><rect id="{id}" ' + 
	        ' class="{cls}" style="position:relative;" x="0" y="0" fill="{fill}" ' +
	        'width="{width}" height="{height}" stroke="{strokecolor}" strokewidth="{strokeweight}" rx="20">' + 
	        '</rect><text x="5" y="15" font-family="Verdana" font-size="9">{text}</text></g>')
});
YAHOO.ext.SVG.Polyline = function(renderTo,config){
	this.strokecolor = 'blue';
	this.strokeweight = '2';
	YAHOO.ext.SVG.Polyline.superclass.constructor.call(this,renderTo,config);
}
YAHOO.extendX(YAHOO.ext.SVG.Polyline, YAHOO.ext.Vector.Polyline,{
	render : function(renderTo){
		var s = "";
       	for(var i=0; i<this.pts.length; i++) {
       		s += this.pts[i].x + ',' + this.pts[i].y + ' ';
       	}
        this.polyTemplate = new YAHOO.ext.DomHelper.Template('<polyline id="' + YAHOO.util.Dom.generateId() + '" ' + 
        'fill="none" stroke="{strokecolor}" stroke-width="{strokeweight}" ' + 
        'points="' + s + '"></polyline>');
       	this.el = this.polyTemplate.append(getEl(renderTo).dom, this, true);
	}
});
YAHOO.ext.SVG.Group = function(renderTo, config){
	this.left = 0;
	this.top = 0;
	YAHOO.ext.util.Config.apply(this,config);	
	this.groupTemplate = new YAHOO.ext.DomHelper.Template('<svg x="{left}" y="{top}"' +
		' xmlns="http://www.w3.org/2000/svg" />');
	this.el = this.groupTemplate.append(getEl(renderTo).dom, this, true);
	this.getEl = function(){
		return this.el;
	}
}
